// 抽奖页面框架
import componentBehavior from '../../../behaviors/component';
import { COMPONENT_OPTIONS } from '../../../constants/common';
import { PACKAGE_MARKET_PAGE } from '../../../constants/route';
import { navTo, navBack } from '../../../common/env';

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        // 活动id
        activityId: {
            type: String,
            value: '',
        },
        // 页面标题
        title: {
            type: String,
            value: '抽奖',
        },
        // 滚动列表数据
        noticeList: {
            type: Array,
            value: [],
        },
        // 抽奖次数
        count: {
            type: Number,
            value: 0,
        },
    },
    methods: {
        // 跳转到中奖记录
        handleToRecord() {
            const { activityId } = this.data;
            navTo(PACKAGE_MARKET_PAGE.lotteryRecord, {
                activityId,
            });
        },
        handleShare() {
            this.triggerEvent('share');
        },
        navBack: navBack,
    }
})
